#pragma once
class CriticalSectionLock
{
public:
	CriticalSectionLock(void);
	~CriticalSectionLock(void);

	void lock()
	{  
		//::EnterCriticalSection(&m_cs);
		 DWORD d = WaitForSingleObject(m_mutex, INFINITE);
	}  
	void unlock()
	{  
		//::LeaveCriticalSection(&m_cs);
		::ReleaseMutex(m_mutex);
	}

protected:
	//CRITICAL_SECTION m_cs;
	HANDLE m_mutex;

};

